Interface java.io.DataInput
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface java.io.DataInput

public interface DataInput
The data input interface is implemented by streams that can read primitive Java data types from a stream in a machine-independent manner.

Version:
1.9, 07/01/98
Author:
Frank Yellin
Since:
JDK1.0
See Also:
DataInputStream, DataOutput

Method Index

 o readBoolean()
Reads a boolean value from the input stream.
 o readByte()
Reads a signed 8-bit value from the input stream.
 o readChar()
Reads a Unicode char value from the input stream.
 o readDouble()
Reads a double value from the input stream.
 o readFloat()
Reads a float value from the input stream.
 o readFully(byte[])
Reads b.length bytes into the byte array.
 o readFully(byte[], int, int)
Reads b.length bytes into the byte array.
 o readInt()
Reads an int value from the input stream.
 o readLine()
Reads the next line of text from the input stream.
 o readLong()
Reads a long value from the input stream.
 o readShort()
Reads a 16-bit value from the input stream.
 o readUTF()
Reads in a string that has been encoded using a modified UTF-8 format.
 o readUnsignedByte()
Reads an unsigned 8-bit value from the input stream.
 o readUnsignedShort()
Reads an unsigned 16-bit value from the input stream.
 o skipBytes(int)
Skips exactly n bytes of input.

Methods

 o readBoolean
public abstract boolean readBoolean() throws IOException
Reads a boolean value from the input stream.

Returns:
the boolean value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readByte
public abstract byte readByte() throws IOException
Reads a signed 8-bit value from the input stream.

Returns:
the 8-bit value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readChar
public abstract char readChar() throws IOException
Reads a Unicode char value from the input stream.

Returns:
the Unicode char read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readDouble
public abstract double readDouble() throws IOException
Reads a double value from the input stream.

Returns:
the double value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readFloat
public abstract float readFloat() throws IOException
Reads a float value from the input stream.

Returns:
the float value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readFully
public abstract void readFully(byte b) throws IOException
Reads b.length bytes into the byte array. This method blocks until all the bytes are read.

Parameters:
b - the buffer into which the data is read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readFully
public abstract void readFully(byte b,
                               int off,
                               int len) throws IOException
Reads b.length bytes into the byte array. This method blocks until all the bytes are read.

Parameters:
b - the buffer into which the data is read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readInt
public abstract int readInt() throws IOException
Reads an int value from the input stream.

Returns:
the int value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readLine
public abstract java.lang.String readLine() throws IOException
Reads the next line of text from the input stream.

Returns:
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readLong
public abstract long readLong() throws IOException
Reads a long value from the input stream.

Returns:
the long value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readShort
public abstract short readShort() throws IOException
Reads a 16-bit value from the input stream.

Returns:
the 16-bit value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readUTF
public abstract java.lang.String readUTF() throws IOException
Reads in a string that has been encoded using a modified UTF-8 format.

For an exact description of this method, see the discussion in Gosling, Joy, and Steele, The Java Language Specification.

Returns:
a Unicode string.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Throws: UTFDataFormatException
if the bytes do not represent a valid UTF-8 encoding of a string.
Since:
JDK1.0
 o readUnsignedByte
public abstract int readUnsignedByte() throws IOException
Reads an unsigned 8-bit value from the input stream.

Returns:
the unsigned 8-bit value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o readUnsignedShort
public abstract int readUnsignedShort() throws IOException
Reads an unsigned 16-bit value from the input stream.

Returns:
the unsigned 16-bit value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0
 o skipBytes
public abstract int skipBytes(int n) throws IOException
Skips exactly n bytes of input.

Parameters:
n - the number of bytes to be skipped.
Returns:
the number of bytes skipped, which is always n.
Throws: EOFException
if this stream reaches the end before skipping all the bytes.
Throws: IOException
if an I/O error occurs.
Since:
JDK1.0

All Packages  Class Hierarchy  This Package  Previous  Next  Index